home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / local / genWebLink.php < prev    next >
PHP Script  |  2010-05-19  |  3KB  |  69 lines

  1. <?php
  2. /**
  3.  * Generate a link to put on a website *** not published ***
  4.  *
  5.  *
  6.  * PHP version 5
  7.  *
  8.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  9.  * that is available through the world-wide-web at the following URI:
  10.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11.  * the PHP License and are unable to obtain it through the web, please
  12.  * send a note to license@php.net so we can mail you a copy immediately.
  13.  *
  14.  * @category   NA
  15.  * @package    NA
  16.  * @author     Nicolas Bruley / Peer 2 World <contact@weezo.net>
  17.  * @copyright  2005-2009 Nicolas Bruley / Peer 2 World
  18.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  19.  * @version    CVS: $Id:$
  20.  * @link       http://www.weezo.net
  21.  * @since      File available since Release 1.0.*
  22.  */
  23.  
  24. // Initialize script data
  25. require_once('localFunctions.php');
  26. require_once(INCLUDE_DIR.'applicationConfigFunctions.php');
  27.  
  28. lfInit();
  29.  
  30. // HEAD
  31. cfInsertHEAD(false);
  32. echo '<meta width="400x'.((isset($_Get    ['user']))?'300':'350').'"></meta>';
  33. echo '<meta wintitle="'.cfCaption('genSiteButton').'"></meta>';
  34. if(!cfIsInApp()) echo cfScriptLink('winClient.js');
  35. echo "</HEAD>\n";
  36. echo '<body onload="genLink()">';
  37. echo outDivFrame('frame1').'<div class="frame1Header">'.cfCaption('genSiteButton').'</div><br>';
  38.  
  39. // User
  40. if(isset($_GET['user'])){
  41.     echo '<input id="includeGroup" type="checkbox" checked="checked" onchange="genLink()">'.cfCaption('genSiteButtonGroup').' ('.cfUTF8Encode($_GET['user']).')<br>';
  42. }
  43. else echo '<input id="includeGroup" style="display:none">';
  44.  
  45. // Password
  46. if(isset($_GET['hasPassword'])){
  47.     echo outTableTransparent('frame1').'<tr><td>';
  48.     echo '<span style="white-space:nowrap;margin-right:2em;"><input id="includePassword" type="checkbox" onchange="genLink()">'.cfCaption('genSiteButtonPassword').cfCaption('genSeparator').'<input type="text" size="10" id="password" onkeyup="genLink()" onblur="genLink()">';
  49.     echo '</span></td><td>';
  50.     echo outImage(outIcon('alert'),false,false,'margin-right:1em;vertical-align:middle').'<span class="warning">'.cfCaption('alertWarningTitle').cfCaption('genSeparator').cfCaption('securityClearPwdWarning').'</span>';
  51.     echo '</td></tr></table>';
  52.  
  53. }
  54. else echo '<input id="includePassword" style="display:none">';
  55.  
  56. // Link frame
  57. echo outDivFrame('frame2');
  58. ?>
  59. <textarea id="webLink" style="width:100%"></textarea>
  60. </div>
  61. <center><?php if(cfIsInApp()) echo outButton(cfCaption('genClose'),'javascript:wl.UICommand(\'close\')',outIcon('close'));?></center>
  62. </div>
  63. <script type="text/javascript">
  64. function genLink(){
  65.     var userName="<?php echo $_GET['userName'];?>";
  66.     var user="<?php if(isset($_GET['user'])) echo $_GET['user'];?>";
  67.     dgi('webLink').value='<scr'+'ipt type="text/javascript" src="http://weezo.net/widget/webLink.php?userName='+userName+(dgi('includeGroup').checked?'&user='+user:'')+(dgi('includePassword').checked?'&password='+dgi('password').value:'')+'" id="weezoBt'+userName+'"></sc'+'ript>';
  68. }
  69. </script>